#ifndef SVM_H
#define SVM_H

#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;

class svm
{
    public:
        string m_classifierpath;
        CvSVM m_svm;
        //CvSVMParams m_params;
        flann::Index m_idx;
        Mat m_points;

        Size win_size;
        float svm_thresval;
        HOGDescriptor m_hog;


        /** Default constructor */
        svm();
        svm( string classfier );

        /** Default destructor */
        virtual ~svm();

        void train( string data_path );
        float predictSvm( Mat test, float thresval);
        vector<RotatedRect> detect(Mat& origImg, Mat& dstImg, Mat& angleImg, Size win_stride, vector< vector<Point> >& lines, float scale);
        Mat getAllSearchregion( Size img_size, vector< vector<Point> >& lines, int buffer );
        vector<Point> getKnnpoints( Point queryPoint, vector< vector<Point> >& lines);
        Mat getPointregion(  Mat& img, Point queryPoint, Size patch_size, float angle );
        Mat get_hogdescriptor_visu(cv::Mat& origImg,std::vector<float>& descriptorValues);
    protected:
    private:
};

#endif // SVM_H
